#ifndef _ATB_H
#define _ATB_H
/*
  author Sylvain Bertrand <digital.ragnarok@gmail.com>
  Protected by GNU Affero GPL v3 with some exceptions.
  See README at root of alga tree.
*/
struct g_ctx
{
	/* workspace data */
	u32 divmul[2];
	u32 fb_wnd;
	u16 data_blk;
	u16 regs_blk;
	u16 io_attr;
	u8 shift;
	u16 io_mode;

	/* compare opcodes */
	bool equal;
	bool above;

	/* parameter space management */
	u32 *ps_top;
	size_t ps_dws;
};

struct atombios
{
	struct mutex mutex;

	struct atb_dev adev;
	struct rom_hdr *hdr;
	u32 *scratch;
	size_t scratch_sz;

	/*
	 * This is an array of 256 pointer indexes on indirect io programs.
	 * The first part 0-127 is for read programs, the second part is
	 * for write programs... in theory.
	 */
	u16 *iio;

	struct g_ctx g_ctx;

	u8 name[512];
};
#endif /* _ATB_H */
